_Pragma("once");

#include <memory>
#include <vector>
#include <unistd.h>
#include <sys/ioctl.h>
#include "BasicDevice.h"
#include "HalUtility.h"

#include "SingletonTemplate.h"


using BuzzerDataPtr = std::shared_ptr<std::vector<int32_t>>;

class Buzzer : public BasicDevice {
    friend class SingletonTemplate<Buzzer>;

public:
    void on() {
        ioctl(deviceFd, IOREQ_BUZZER_ON);
    }


    void off() {
        ioctl(deviceFd, IOREQ_BUZZER_OFF);
    }



    void synchronizedBeep(BuzzerDataPtr pArray);

    void beep(BuzzerDataPtr pArray);
    /** Default destructor */
    virtual ~Buzzer();

protected:
    /** Default constructor */
    Buzzer();


};

using BuzzerSingleton = SingletonTemplate<Buzzer>;

